package com.example.xd.model_video.videoeditlib;

import android.app.Application;
import android.os.Environment;

import com.example.xd.model_video.R;

/**
 * Created by 半米阳光 on 2017/8/28.
 */

public class Constants {

    public static volatile boolean isScreenOffActivityAlive = false;
    public static volatile boolean isCalling = false;

    public static final int REQUEST_READ_EXTERNAL_PERMISSION_CODE = 1;
    public static final String SDCARD_PATH = Environment.getExternalStorageDirectory().toString();
    public static final String APPLICATION_PATH_BASE = SDCARD_PATH + "/colorshow/";
    public static final String APPLICATION_PATH = SDCARD_PATH + "/colorshow/" + ".nomedia/";
    public static final String APPLICATION_VIDEO_SAVE_PATH = SDCARD_PATH + "/colorshow/.nomedia/videosave/";
    public static final String APPLICATION_VIDEO_PATH = SDCARD_PATH + "/colorshow/video/";
    public static final String APPLICATION_PHOTO_PATH = SDCARD_PATH + "/colorshow/photo/";
    public static final String APPLICATION_DOWNLOAD_TEMP_PATH = APPLICATION_PATH + "temp";
    public static final String APPLICATION_GIF_PATH = APPLICATION_PATH + "gif";
    public static final String APPLICATION_TTF_PATH = APPLICATION_PATH + "ttf";
    public static final String APPLICATION_MUSIC_BACKGROUND_PATH = APPLICATION_PATH + "bgm";
    public static final String APPLICATION_TEXT_PATH = SDCARD_PATH + "/colorshow/text";
    public static final String APPLICATION_PIC_VIDEO_PATH = SDCARD_PATH + "/colorshow/picvideo";
    public static final String APPLICATION_PIC_TEMP = SDCARD_PATH + "/colorshow/temp";
    public static final String APPLICATION_INPUT_PARAM_PATH = SDCARD_PATH + "/colorshow/input.txt";
    public static final String APPLICATION_USER_INFO = SDCARD_PATH + "/colorshow/usr";
    public static final String APPLICATION_USER_PROTRAIT = APPLICATION_USER_INFO + "/userpic.jpg";
    public static final String APPLICATION_KEYFRAME = SDCARD_PATH + "/colorshow/keyframes/";
    public static final String APPLICATION_CROP = SDCARD_PATH + "/colorshow/crop/";
    public static final String APPLICATION_LOG = APPLICATION_PATH + "log/";
    public static final String APPLICATION_GIF = APPLICATION_PATH + "gif/";
    public static final String APPLICATION_VIDEO_THUMB = APPLICATION_VIDEO_PATH + "thumb/";
    public static final String FILE_BASE_URL = "http://111.206.133.26:89";

    /**
     * Topbar的样式参数
     */
    public static final int TITLE_FUNCTION = 1;
    public static final int BACK_TITLE_BUTTON = 2;
    public static final int CANCEL_TITLE_BUTTON = 3;
    public static final int BACK_TITLE = 4;
    public static final int TITLE_ICON = 5;
    public static final int BACK_TITLE_SETTING = 6;
    public static final int ICON_TITLE_FUNCTION = 7;


    //朋友圈朋友选择界面，最大选择数量
    public static int MAX_IMAGE_SIZE = 9;

    public static final int TAKE_PHOTO = 1;

    public static final int TAKE_VIDEO = 2;


    //INTENT ACTION
    public static final String TAKE_PHOTO_ACTION = "TAKE_PHOTO";
    public static final String TAKE_VIDEO_ACTION = "TAKE_VIDEO";
    public static final String SELECT_ALBUM_ACTION = "SELECT_ALBUM";
    public static final String SELECT_TYPE = "Type";
    public static final String DATA_LIST = "data";

    //视频项类型
    public static final int UPLOAD_VIDEO = 0;
    public static final int EDITED_VIDEO = 1;
    public static final int UN_EDIT_VIDEO = 2;
    public static final int BELL_HISTORY = 3;
    public static final int EDITING_VIDEO = 4;
    public static final int UPLOADING_VIDEO = 5;

    //设置界面
    public static final int PRIVACY_POLICY = 1;
    public static final int LEGAL_DOCUMENT = 2;
    public static final int ABOUT_US = 3;


    //Video Params
    public static final int VIDEO_LENGTH = 15000; //15s

    //Pic2Video / VideoCut Params
    public static final long MIN_CUT_DURATION = (long) (1.5 * 1000L);// 最小剪辑时间1s
    public static final long MAX_CUT_DURATION = 6 * 1000L;//视频最多剪切多长时间
    public static final int MAX_COUNT_RANGE = 10;//seekBar的区域内一共有多少张图片
    public static final int MAX_COUNT_RANGE_PIC = 2;
    public static final int PIC_TIME = 3000;

    //升级相关
    public static final String FORCED_ESCRIPTION = "当前版本过低，请立即升级！";
    public static final String NONEED_DESCRIPTION = "当前版本无需更新";
    public static final String ERROR_DESCRIPTION = "版本号错误";
    public static String newVersion;
    public static String apkPath;
    public static String downUrl;

    //第三方分享
    public static final String WX_APP_ID = "wx4ee355ba026ec98b";    //微信
    public static final String WB_APP_ID = "2676624869";    //微博
    public static final String REDIRECT_URL = "https://api.weibo.com/oauth2/default.html";
    public static final String SCOPE = null;
    public static final String QQ_APP_ID = "    ";   //todo QQ
    public static final String SHARE_TITLE = "我在秀东西上分享了一个视频，快来看看吧";
    //分享的类型
    public static final byte SHARE_TO_WX_SESSION = 0;
    public static final byte SHARE_TO_WX_TIMELINE = 1;
    public static final byte SHARE_TO_WEIBO = 2;
    public static final byte SHARE_TO_QQ = 3;


    //                 中国电信号码格式验证 手机段： 133,153,180,181,189,177,1700
    public static final String CHINA_TELECOM_PATTERN = "(^1(33|53|77|8[019])\\d{8}$)|(^1700\\d{7}$)";
    //               中国联通号码格式验证 手机段：130,131,132,155,156,185,186,145,176,1709
    public static final String CHINA_UNICOM_PATTERN = "(^1(3[0-2]|4[5]|5[56]|7[6]|8[56])\\d{8}$)|(^1709\\d{7}$)";
    //                 移动手机段：134,135,136,137,138,139,150,151,152,157,158,159,182,183,184,187,188,147,178,1705
    public static final String CHINA_MOBILE_PATTERN = "(^1(3[4-9]|4[7]|5[0-27-9]|7[8]|8[2-478])\\d{8}$)|(^1705\\d{7}$)";


    public static final int EDITING_COMPLETE = 3;

}
